package cn.stylefeng.guns.sys.modular.system.mapper;

import cn.stylefeng.guns.sys.modular.system.entity.BtyMdCaiwu;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyMdCaiwuParam;
import cn.stylefeng.guns.sys.modular.system.model.result.BtyMdCaiwuResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 门店财务主表 Mapper 接口
 * </p>
 *
 * @author jiangge
 * @since 2021-09-08
 */
public interface BtyMdCaiwuMapper extends BaseMapper<BtyMdCaiwu> {

    /**
     * 获取列表
     *
     * @author jiangge
     * @Date 2021-09-08
     */
    List<BtyMdCaiwuResult> customList(@Param("paramCondition") BtyMdCaiwuParam paramCondition);

    /**
     * 获取map列表
     *
     * @author jiangge
     * @Date 2021-09-08
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") BtyMdCaiwuParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author jiangge
     * @Date 2021-09-08
     */
    Page<BtyMdCaiwuResult> customPageList(@Param("page") Page page, @Param("paramCondition") BtyMdCaiwuParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author jiangge
     * @Date 2021-09-08
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") BtyMdCaiwuParam paramCondition);

    //DELETE bty_md_caiwu where kjqj=#{month};
    void deleteCaiWuAndZcfzbData(@Param("month") String month, @Param("monthNum") Long monthNum);

    void deleteCaiWuAndLirunData(@Param("month") String month, @Param("monthNum") Long monthNum);

    void deleteCaiWuAndLirunzgData(@Param("month") String month, @Param("monthNum") Long monthNum);

    /**
    删除主表中没有资产负债表数据和利润表数据的主表数据
     */
    void deleteCaiWuData(@Param("month") String month);

    void deleteCaiWuAndPsmxData(@Param("month") String lastMonthStr, @Param("monthNum") String lastMonth);

    void deleteCaiWuAndSfcData(@Param("month") String lastMonthStr, @Param("monthNum") String lastMonth);

    List<BtyMdCaiwu> getCw(@Param("list") List<Long> cwIdList);

    void updateCw(@Param("list") List<BtyMdCaiwu> list);

    void insertCw(@Param("list") List<BtyMdCaiwu> list);

    void updateCwPs(@Param("list") List<BtyMdCaiwu> list);

    void insertCwPs(@Param("list") List<BtyMdCaiwu> list);
}
